/**
 * Copyright [2019] [LiBo/Alex of copyright liboware@gmail.com ]
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.hyts.infodb.bean.po;

import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.UpdateTimestamp;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @project-name:infodb
 * @package-name:com.hyts.infodb.bean.po
 * @author:LiBo/Alex
 * @create-date:2020-02-21 21:44
 * @copyright:libo-alex4java
 * @email:liboware@gmail.com
 * @description:
 */
@Data
@Accessors(chain=true)
@MappedSuperclass
public class StringPO implements Serializable {

    /**
     * @fieldName serialVersionUID
     * @fieldType long
     */
    private static final long serialVersionUID = 835521985612437021L;

    /**
     * <p>主键ID</p>
     * @fieldName id
     * @fieldType Long
     */
    @Id
    @GenericGenerator(name = "uuid", strategy = "uuid")
    public String id;

    /**
     * <p>创建时间</p>
     * @fieldName createDate
     * @fieldType Date
     */
    @Column(name="CREATE_DATE")
    @CreationTimestamp
    @DateTimeFormat(style="yyyy-MM-dd HH:mm:ss")
    public Date createDate;

    /**
     * <p>修改时间</p>
     * @fieldName editDate
     * @fieldType Date
     */
    @Column(name="EDIT_DATE")
    @DateTimeFormat(style="yyyy-MM-dd HH:mm:ss")
    @UpdateTimestamp
    public Date editDate;

    /**
     * <p>用户ID</p>
     * @fieldName userId
     * @fieldType Long
     */
    @Column(name="USER_ID")
    private String userId;
}
